using cfg.level;
using UnityEngine;
using UnityEngine.UI;
using QFramework;

namespace QFramework.Monk
{
	public class UIGameStartData : UIPanelData
	{
	}
	public partial class UIGameStart : UIPanel,IController
	{
		protected override void OnInit(IUIData uiData = null)
		{
			mData = uiData as UIGameStartData ?? new UIGameStartData();
			// please add init code here
			
			Start.onClick.AddListener(() =>
			{
				this.CloseSelf();
				AppStart.ChangeGameState(GameState.GamePlaying);
			});
			
			CoinUp.onClick.AddListener(() =>
			{
					CoinUpPanel.Show();
			});
			
			AppStart.goldNum.RegisterWithInitValue(((num =>
			{
				
				CoinNum.text = "金币："+num;
				
			}))).UnRegisterWhenGameObjectDestroyed(this.gameObject);
		}
		
		protected override void OnOpen(IUIData uiData = null)
		{
			CoinUpPanel.Hide();
		}
		
		protected override void OnShow()
		{
		}
		
		protected override void OnHide()
		{
		}
		
		protected override void OnClose()
		{
		}

		public IArchitecture GetArchitecture()
		{
			return AppStart.Interface;
		}
	}
}
